Skip to content

CLI: Verify SDK v0.85.0 coverage and add managed-auth, replay, and credential flags - #210

Merged
rgarcia merged 5 commits into
mainfrom
cli-coverage-update
Jul 31, 2026
Merged

CLI: Verify SDK v0.85.0 coverage and add managed-auth, replay, and credential flags#210
rgarcia merged 5 commits into
mainfrom
cli-coverage-update

Conversation

@kernel-internal

@kernel-internal kernel-internal Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

This PR updates the Go SDK to e6dff4a41334b0008f7d0469bf83477905cdc589 and adds CLI flags for uncovered SDK request-param fields.

SDK Update

  • e6dff4a41334b0008f7d0469bf83477905cdc589 is the v0.85.0 tag, which go.mod already pinned. go get + go mod tidy resolved to the same version, so there is no dependency change in this push. The api.md diff against the CLI's previous SDK version is empty.

Coverage Analysis

A full enumeration was performed rather than relying on the (empty) diff:

  • 128 SDK methods extracted from api.md — all have corresponding CLI commands. The three that don't call the plain SDK method (Browsers.Logs.Stream, Browsers.Telemetry.Stream, Browsers.Process.StdoutStream) use the SSE *Streaming variants and are covered by browsers logs stream, browsers telemetry stream, and browsers process stdout-stream.
  • 286 request-param fields extracted from all *Params/*Param structs and checked against every identifier in cmd/ and pkg/. This surfaced 8 pre-existing gaps, closed below.
  • The one endpoint marked x-cli-skip: true (POST /auth/connections/{id}/exchange, the hosted login UI's handoff exchange) is correctly absent.

Build Fix

The merge of main into this branch unioned two independent implementations of the proxy CA bundle feature (this branch's, and #212 on main), leaving the tree uncompilableundefined: io, and in.CaBundle referenced on a struct without that field.

Resolved to main's shipped --ca-bundle <path> semantics and dropped the duplicate inline/stdin variant. Worth noting: keeping both would have silently redefined --ca-bundle from "path to a PEM file" to "inline PEM content" for anyone already using the flag from main.

New Flags

Flag SDK field
kernel auth connections create --record-session ManagedAuthCreateRequestParam.RecordSession
kernel auth connections create --no-health-checks ManagedAuthCreateRequestParam.HealthChecks
kernel auth connections create --no-auto-reauth ManagedAuthCreateRequestParam.AutoReauth
`kernel auth connections update --record-session[=true false]`
kernel auth connections update --health-checks / --no-health-checks ManagedAuthUpdateRequestParam.HealthChecks
kernel auth connections update --auto-reauth / --no-auto-reauth ManagedAuthUpdateRequestParam.AutoReauth
`kernel auth connections login --record-session[=true false]`
kernel browsers replays start --record-audio BrowserReplayStartParams.RecordAudio
kernel credentials update --remove-value-key UpdateCredentialRequestParam.RemoveValueKeys

--record-session is a single tri-state boolean on create, update, and login: omitting it leaves the API default or existing connection setting untouched, --record-session sends true, and --record-session=false sends false. The remaining positive/negative update pairs are marked mutually exclusive.

Deliberately Not Added

BrowserCurlParams.TimeoutMs and BrowserCurlParams.ResponseEncoding. kernel browsers curl does not call the SDK's Curl method — it proxies through a raw HTTP client (browsers.HTTPClient) for binary-safe streaming, header dumping, and --write-out. --max-time already covers the timeout, and response encoding is meaningless when raw bytes go straight to stdout or -o. Adding either flag would give the user a knob wired to nothing.

Testing

Against the live API, with all resources deleted afterward:

  • auth connections create --record-session --no-health-checks --no-auto-reauth → response echoed record_session=true, health_checks=false, auto_reauth=false
  • auth connections update exercised in both directions, plus an unrelated-field-only update (--health-check-interval 3600) confirming omitted toggles are left untouched
  • Mutually-exclusive pairs correctly rejected
  • credentials update --remove-value-key otp_backup → key removed; --remove-value-key password --value password=newsecret → new value kept, confirming removals apply before the merge
  • browsers replays start --record-audio → started, stopped, and listed successfully
  • Request bodies captured against a local listener to verify tri-state on the wire (the API does not echo these fields back): {"record_audio":true} vs {}, and {"record_session":true} / {"record_session":false} / {}
  • go build ./..., go vet ./..., gofmt -l cmd/, and go test -count=1 ./... all pass

Triggered by: kernel/kernel-go-sdk@e6dff4a
Reviewer: @stainless-app


Note

Low Risk
Changes are additive CLI-to-API mappings and display tweaks; managed-auth toggles affect connection behavior only when users set them explicitly.

Overview
Wires previously uncovered Go SDK request fields into the CLI and tightens a few command outputs.

Managed auth (kernel auth connections) gains flags for health checks, auto re-auth, and session recording: create uses --no-health-checks, --no-auto-reauth, and --record-session; update adds paired --health-checks / --no-health-checks and --auto-reauth / --no-auto-reauth (tri-state, like save-credentials) plus --record-session; login can override recording per flow. timeline adds a Telemetry column (yes/no when the event has a browser session and the API reports telemetry_captured).

Browsers replays start adds --record-audio. Credentials update adds repeatable --remove-value-key (applied before --value merges). Shared readBoolFlag distinguishes omitted bool flags from explicit false.

Proxies surface Has CA Bundle in check/get/list/create output, warn when --ca-bundle is used on non-custom types, and note CA bundle on custom proxy list lines.

Reviewed by Cursor Bugbot for commit 174f857. Bugbot is set up for automated code reviews on this repo. Configure here.

kernel-internal Bot and others added 2 commits July 27, 2026 20:53
… timeline

Updates github.com/kernel/kernel-go-sdk to 65f3b913775353974858c92a6164ae25232ecc81
(v0.84.0).

A full enumeration of api.md methods against the CLI service interfaces found no
missing commands: all 128 SDK methods are covered (the one x-cli-skip endpoint,
POST /auth/connections/{id}/exchange, is correctly absent). The only API surface
change in this SDK bump is a new response field, ManagedAuthTimelineEvent.
TelemetryCaptured, so no new flags were needed.

Surfaces that field as a "Telemetry" column in `kernel auth connections timeline`,
so users can tell which timeline events have browser telemetry available via
`kernel browsers telemetry events`. The column shows "-" when the event has no
browser session or when the API does not report the field, and yes/no otherwise.
JSON output already passes the field through verbatim.

Tested against the live API:
- kernel auth connections timeline <id> --per-page 5 (three connections)
- kernel auth connections timeline <id> --per-page 2 --output json
- kernel auth connections list, kernel browsers list, kernel profiles list
- go build ./... and go test ./... pass

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Updates github.com/kernel/kernel-go-sdk to
e6dff4a41334b0008f7d0469bf83477905cdc589 (v0.85.0).

Full enumeration of all 127 SDK methods in api.md against the CLI command
tree found no missing commands. The only coverage gap was a new param field
on ProxyNewParamsConfigCustom.

New flags on `kernel proxies create`:
- --ca-bundle: inline PEM-encoded CA certificate bundle
- --ca-bundle-file: read the bundle from a file ('-' for stdin)
The two are mutually exclusive; the bundle is rejected early if it is not
PEM-encoded, and warned about (ignored) for non-custom proxy types.

Surfaces the new has_ca_bundle response field:
- `proxies get` / `proxies check`: "Has CA Bundle" row
- `proxies list`: "CA bundle" marker in the Config column
- `proxies create`: confirms the write-only bundle was stored

Tested:
- Real API: `proxies create --type custom --ca-bundle-file` reaches
  server-side ca_bundle validation ("ca_bundle must be 65536 bytes or less,
  got 80569" for an oversized bundle; a valid bundle passes that check and
  only fails the live proxy connection test, as no reachable MITM proxy is
  available from CI). No resources leaked.
- Local mock API: verified the wire body carries the full PEM as `ca_bundle`
  for inline, file, and stdin inputs, and that has_ca_bundle renders in
  create/get/list/check output.
- Flag errors: mutual exclusion, non-PEM input, missing file, non-custom
  warning.
- go build ./..., go vet ./..., go test ./... all pass (6 new unit tests).

Triggered by: kernel/kernel-go-sdk@e6dff4a

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@kernel-internal kernel-internal Bot changed the title CLI: Update SDK to v0.84.0 and surface auth timeline telemetry state CLI: Update SDK to v0.85.0 and add proxy CA bundle flags Jul 29, 2026
Comment thread cmd/proxies/create.go
kernel-internal Bot and others added 2 commits July 31, 2026 13:37
SDK e6dff4a is the v0.85.0 tag the CLI already pins, so go.mod is unchanged
and the api.md diff against the previous version is empty. A full enumeration
of all 128 SDK methods and 286 request-param fields was performed anyway,
which surfaced pre-existing coverage gaps that are closed here.

Fix broken merge in cmd/proxies:
The merge of main into this branch unioned two independent implementations of
the proxy CA bundle feature, leaving the tree uncompilable (undefined io,
in.CaBundle on a struct without that field). Resolved to main's shipped
--ca-bundle <path> semantics and dropped the duplicate inline/stdin variant,
which would otherwise have silently redefined --ca-bundle for existing users.

New flags:
- kernel auth connections create --record-session / --no-health-checks /
  --no-auto-reauth (ManagedAuthCreateRequestParam.{RecordSession,HealthChecks,
  AutoReauth})
- kernel auth connections update --record-session / --no-record-session,
  --health-checks / --no-health-checks, --auto-reauth / --no-auto-reauth
  (ManagedAuthUpdateRequestParam, tri-state: omitting both leaves the
  connection's current value untouched)
- kernel auth connections login --record-session / --no-record-session
  (AuthConnectionLoginParams.RecordSession, per-login override)
- kernel browsers replays start --record-audio
  (BrowserReplayStartParams.RecordAudio)
- kernel credentials update --remove-value-key
  (UpdateCredentialRequestParam.RemoveValueKeys)

BrowserCurlParams.{TimeoutMs,ResponseEncoding} are intentionally left
unexposed: kernel browsers curl does not call the SDK's Curl method, it
proxies through a raw HTTP client for binary-safe streaming. --max-time
already covers the timeout, and response encoding is meaningless when raw
bytes go straight to stdout.

Tested against the live API:
- auth connections create --record-session --no-health-checks --no-auto-reauth
  -> response echoed record_session=true, health_checks=false,
  auto_reauth=false
- auth connections update, both directions, plus an unrelated-field-only
  update confirming omitted toggles are left untouched
- mutually-exclusive pairs rejected (--health-checks with --no-health-checks)
- credentials update --remove-value-key removed the key; combined with
  --value on the same key, the new value is kept (removal applied first)
- browsers replays start --record-audio -> started, stopped, listed
- request bodies captured against a local listener confirming tri-state on the
  wire: {"record_audio":true} / {} and {"record_session":true} /
  {"record_session":false} / {}
- all test resources deleted; go build, go vet, gofmt and go test ./... pass

Triggered by: kernel/kernel-go-sdk@e6dff4a

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@kernel-internal kernel-internal Bot changed the title CLI: Update SDK to v0.85.0 and add proxy CA bundle flags CLI: Verify SDK v0.85.0 coverage and add managed-auth, replay, and credential flags Jul 31, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7f6bf41. Configure here.

Comment thread cmd/auth_connections.go Outdated

@rgarcia rgarcia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed after conflict reconciliation and record-session tri-state cleanup. Full tests, build, security scans, and Bugbot pass.

@rgarcia
rgarcia merged commit bfe03b3 into main Jul 31, 2026
7 checks passed
@rgarcia
rgarcia deleted the cli-coverage-update branch July 31, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant